Chart for WPF and Silverlight > Chart Features > Axis > Dependent Axis |
The IsDependent allows to link the auxiliary axis with one from the main axes (AxisX or AxisY, depending on AxisType). The dependent axis always has the same minimum and maximum as the main axis.
New property DependentAxisConverter and delegate Axis.AxisConverter specifies function that is used to convert coordinate from main axis to the dependent axis.
The following code creates a dependent Y-Axis:
C# |
Copy Code
|
---|---|
c1Chart1.Reset(true); c1Chart1.Data.Children.Add( new DataSeries() { ValuesSource = new double[] { -10, 0, 10, 20, 30, 40 } }); c1Chart1.ChartType = ChartType.LineSymbols; Axis axis = new Axis() { AxisType = AxisType.Y, IsDependent =true}; // Celsius -> Fahrenheit axis.DependentAxisConverter = (val) => val * 9 / 5 + 32; c1Chart1.View.Axes.Add(axis); |
The following image displays the dependent (leftmost) Y-Axis that shows values in Fahrenheit corresponding to the Celsius on the main Y-axis: